<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/usercenter.css" rel="stylesheet" type="text/css"/>
</block>

<block name="body">
    <div class="col-md-12 usercenter">
        <include file="Public/user_info"/>
        <include file="Public/_top_menu"/>
        <div class="uc_content">
            <div class="col-xs-12 uc_top common_block_border mt_0" style="margin-bottom: 8px;">
                <if condition="is_login() && $user_info['uid'] eq is_login()">
                    <div style="position: absolute;right: 10px;top: 10px;padding: 5px 10px;background: #9f9f9f;z-index: 999"><a
                            href="#personal_cover" class="open-popup-link" style="color: white">编辑个人形象照</a></div>
                </if>
               <if condition="!count($cover['cover_ids'])">
                    <img id="now_personal_cover" style="width: 100%;" src="__IMG__/uc_top.jpg"/>
                   <else/>
                   <link id="main_stylesheet" rel="stylesheet" href="__PUBLIC__/Core/js/ext/aktuals/css/style.css"
                         type="text/css"/>
                   <!--[if lte IE 7]>
                   <style type="text/css">
                       html .jqueryslidemenu {
                           height: 1%;
                       }

                       /* Holly Hack for IE7 and below */
                   </style>
                   <![endif]-->
                   <script type="text/javascript" src="__PUBLIC__/Core/js/ext/aktuals/js/jquery.easing.1.3.js"></script>
                   <script type="text/javascript" src="__PUBLIC__/Core/js/ext/aktuals/js/jquery.scrollTo-min.js"></script>
                   <script type="text/javascript" src="__PUBLIC__/Core/js/ext/aktuals/js/aktuals.js"></script>
                   <div class="header_slider hidden-sm hidden-xs"
                        style="background-color: #fff;box-shadow: 0px 2px 8px #BBB;">
                       <div class="content">
                           <div class="homepage-wrapper">
                               <div class="homepage-slider">
                                   <a href="#" class="btn-previous" onmouseover="set_hover_on();" onmouseout="set_hover_off();" onclick="scrollLefty(); return false;">&nbsp;</a>
                                   <a href="#" class="btn-next" onmouseover="set_hover_on();" onmouseout="set_hover_off();" onclick="scrollRight(); return false;">&nbsp;</a>
                                   <span class="rounded-corners">&nbsp;</span>

                                   <div id="aktuals_field" style="overflow:hidden; position:relative;width:100%;">
                                       <table>
                                           <tr>
                                               <php>$j=1;
                                                   $count = count($cover['cover_ids']);
                                               </php>
                                               <volist name="cover.cover_ids" id="vo">
                                                   <td>
                                                       <div class="homepage-slider-item" id="aktuals{$i}" >
                                                           <img src="{$vo|getThumbImageById=1070,305}" style="width: 100%" class="img-responsive">
                                                       </div>
                                                   </td>
                                                   <php>
                                                       if($j >= $count){
                                                       $j=1;
                                                       }else{
                                                       $j++;
                                                       }
                                                   </php>
                                               </volist>

                                           </tr>
                                       </table>
                                   </div>
                                   <script>slider_count = {$count};</script>
                               </div>
                           </div>
                       </div>
                   </div>
                </if>




                <div class="clearfix"></div>



            </div>
            <div class="col-md-3 col-xs-12 uc_left common_block_border mt_0" style="min-height: 645px;">
                <php>
                    $class_left="col-lg-4 col-xs-6";
                    $class_right="col-lg-8 col-xs-6";
                </php>
                <ul>
                    <if condition="$notHaveInfo">
                        <li>
                            <div class="{$class_left}" style="text-align: center;">姓名：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">性别：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">职业：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">地址：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">星座：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">民族：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">身高：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">体重：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">三围：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">生日：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">家乡：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">公司：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">手机：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">Q Q：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">邮箱：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微信：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微博：</div>
                            <div class="{$class_right}">还未设置</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">标签：</div>
                            <div class="{$class_right}">
                                <if condition="count($member_info['label'])">
                                    <volist name="member_info['label']" id="val">
                                        <span style="margin-right: 5px">{$val.title}</span>
                                    </volist>
                                    <else/>
                                    还未添加
                                </if>

                            </div>
                        </li>
                        <else/>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">姓名：</div>
                            <div class="{$class_right}">{$member_info.name}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">性别：</div>
                            <div class="{$class_right}">{$member_info.sex}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">职业：</div>
                            <div class="{$class_right}">{$member_info.doing}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">地址：</div>
                            <div class="{$class_right}">{$member_info.address}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">星座：</div>
                            <div class="{$class_right}">{$member_info.sign}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">民族：</div>
                            <div class="{$class_right}">{$member_info.national}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">身高：</div>
                            <div class="{$class_right}">{$member_info.height}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">体重：</div>
                            <div class="{$class_right}">{$member_info.weight}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">三围：</div>
                            <div class="{$class_right}">{$member_info.bwh}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">生日：</div>
                            <div class="{$class_right}">{$member_info.birthday}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">家乡：</div>
                            <div class="{$class_right}">{$member_info.home_address}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">公司：</div>
                            <div class="{$class_right}">{$member_info.company}</div>
                        </li>
                        <php>
                            $member_info['is_following'] = D('Follow')->where(array('who_follow'=>is_login(),'follow_who'=>$member_info['uid']))->find();
                            if($member_info['uid']==is_login()||$member_info['is_following']){
                        </php>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">手机：</div>
                            <div class="{$class_right}">{$member_info.mobile}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">Q Q：</div>
                            <div class="{$class_right}">{$member_info.qq}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">邮箱：</div>
                            <div class="{$class_right}">{$member_info.email}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微信：</div>
                            <div class="{$class_right}">{$member_info.wechat}</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微博：</div>
                            <div class="{$class_right}">就是亚军</div>
                        </li>
                        <php>}else{</php>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">手机：</div>
                            <div class="{$class_right}">关注后才能看到</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">Q Q：</div>
                            <div class="{$class_right}">关注后才能看到</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">邮箱：</div>
                            <div class="{$class_right}">关注后才能看到</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微信：</div>
                            <div class="{$class_right}">关注后才能看到</div>
                        </li>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">微博：</div>
                            <div class="{$class_right}">关注后才能看到</div>
                        </li>
                        <php>}</php>
                        <li>
                            <div class="{$class_left}" style="text-align: center;">标签：</div>
                            <div class="{$class_right}">
                                <if condition="count($member_info['label'])">
                                    <volist name="member_info['label']" id="val">
                                        <span style="margin-right: 5px">{$val.title}</span>
                                    </volist>
                                    <else/>
                                    还未添加
                                </if>

                            </div>
                        </li>
                    </if>

                </ul>
            </div>
            <div class="col-md-9 col-xs-12 uc_right" style="padding-left: 10px;padding-right: 0;">
                <div class=" col-xs-12 common_block_border mt_0" style="padding: 10px;min-height: 645px">
                    <div id="flash_html" style="width: 100%;height:470px">
                        <if condition="$have_flash eq 2">
                            <embed src="{$flash.flash_url}" autostart="false" allowFullScreen="true" quality="high"
                                   width="100%" height="470px" align="middle" allowScriptAccess="always"  wmode="Opaque"
                                   type="application/x-shockwave-flash" title="{$flash.title}"></embed>
                        </if>
                        <if condition="$have_flash eq 1">
                            <p class="text-muted" style="text-align: center; font-size: 3em;">
                                <br><br>
                                视频地址出错了吆。O(∩_∩)O~
                                <br><br><br>
                            </p>
                        </if>
                        <if condition="$have_flash eq 0">
                            <p class="text-muted" style="text-align: center; font-size: 3em;">
                                <br><br>
                                还未上传视频吆。O(∩_∩)O~
                                <br><br><br>
                            </p>
                        </if>
                    </div>
                    <div class="col-xs-12 uc_right_bottom" style="margin-top: 30px;">
                        <ul>
                            <volist name="view_list" id="vo">
                                <li><a class="view-list" flash-url="{$vo.flashinfo.flash_url}" flash-title="{$vo.flashinfo.title}"><img src="{$vo.flashinfo.image_url}" style="width: 130px;height: 93px;"></a></li>
                            </volist>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <if condition="is_login() && $user_info['uid'] eq is_login()">
        <div id="personal_cover" class="white-popup mfp-hide" style="">
            <div style="text-align: center;">
<!--                <div style="margin-left: 47px;margin-top: 26px;">
                    <input type="file" id="upload_picture_cover">
                </div>-->



                <div class=" col-sm-12" style="">
                    <div class="publish_right_label" style="margin-top: 10px;font-size: 16px;font-weight: 700">添加图片（限三张）：</div>
                    <div class="pull-left publish_work_image_list" id="add_image" style="margin-left: 15px;">
                        <input type="hidden" name="image" id="image_{$unid}" value="{:implode(',',$cover['cover_ids'])}">
                        <div class="img-list clearfix">
                            <ul id="ul_{$unid}" style="-webkit-padding-start: 0px;">

                                <php>if($cover){</php>
                                <volist name="cover.cover_ids" id="image">
                                    <li id="li_{$unid}_{$key}"><img src="{$image|get_cover='path'}" width="80" height="80" />
                                        <a href="javascript:;" onclick="multi_upload.removeImage('{$unid}', '{$key}','{$image}' )">
                                            <span class="del">删除</span>
                                        </a>
                                    </li>
                                </volist>

                                <php>}</php>



                                <li id="btn_{$unid}"><input style="display:none" id="uploadify_{$unid}" type="file" /></li>
                            </ul>
                        </div>
                    </div>

                </div>



                <div style="margin-top: 10px">
                    <span>宽度 1130 像素</span>
                </div>
                <div style="margin-top: 10px">
                    <span>高度 380 像素</span>
                </div>
                <button id="cover_submit" class="btn btn-primary" style="margin-top: 10px;">确定</button>
            </div>
            <style>
                #upload_picture_cover-button {
                    background-color: #f36119;
                    border-color: #f36119;
                }
            </style>
        </div>
        <script type="text/javascript" src="__PUBLIC__/Core/js/multi_upload.js"></script>
        <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
        <script>
            var unid = "{$unid}",
           fileSizeLimit = "{$fileSizeLimit}",
                    total = 3;
            $('#uploadify_'+unid).uploadify({
                formData: {
                    attach_type: 'feed_image',
                    upload_type: 'image',
                    thumb: 1,
                    width: 100,
                    height: 100,
                    cut: 1,
                    PHPSESSID: "<?php echo session_id(); ?>"
                },
                fileSizeLimit: fileSizeLimit,
                fileTypeDesc: 'Image Files',
                fileTypeExts:  '*.jpg; *.png; *.gif;',
                swf: '__STATIC__/uploadify/uploadify.swf',
                uploader: "{:U('Home/File/uploadPicture',array('session_id'=>session_id()))}",
                width: 80,
                height: 80,
                buttonImage: '__ROOT__/Addons/InsertImage/_static/image/add-photo-multi.png',
                queueSizeLimit:3,
                queueID: true,
                overrideEvents: ['onSelectError', 'onDialogClose'],
                onUploadSuccess : function(file, data, response) {
                    var jsondata = $.parseJSON(data);
                    multi_upload.removeLoading(unid);
                    if (jsondata.status === 1) {
                        $('#btn_'+unid).before($('<li id="li_'+unid+'_'+file.index+'"><img src="'+jsondata.path+'" width="80" height="80" /><a href="javascript:;" onclick="multi_upload.removeImage(\''+unid+'\', '+file.index+', '+jsondata.id+')"><span class="del">删除</span></a></li>').fadeIn('slow'));
                    }
                    multi_upload.upAttachVal('add', jsondata.id,unid);
                },
                onUploadStart: function (file) {
                    multi_upload.addLoading(unid);
                    var len = $('#ul_'+unid).find('li').length-1;
                    if (len > total) {
                        multi_upload.removeLoading(unid);
                        toast.error('最多只能上传' + total + '个图片');
                        // 停止上传
                        $('#uploadify_'+unid).uploadify('stop');
                        // 移除队列
                        $('#uploadify_'+unid).uploadify('cancel', file.id);
                    }
                }    ,
                onSelectError: function (file, errorCode, errorMsg) {
                    switch (errorCode) {
                        case -100:
                            toast.error('选择的上传数目超过，您还能上传'+errorMsg+'个图片');
                            break;
                        case -110:
                            toast.error("文件 [" + file.name + "] 大小超出系统限制的" + $('#uploadify_'+unid).uploadify('settings', 'fileSizeLimit') + "大小", 4);
                            break;
                        case -120:
                            toast.error("文件 [" + file.name + "] 大小异常");
                            break;
                        case -130:
                            toast.error("文件 [" + file.name + "] 类型不正确");
                            break;
                    }
                },
                onFallback: function () {
                    toast.error('您未安装FLASH控件，无法上传！请安装FLASH控件后再试');
                }
            });

            $('#cover_submit').click(function(){
                $.post(U('usercenter/index/editcover'), {cover: $('input[name=image]').val()}, function (msg) {
                    if (msg.status == 1) {
                        toast.success('个人形象照上传成功。', '温馨提示');
                        setTimeout(function(){
                            location.reload();
                        },1000)

                    } else {
                        toast.error('上传的个人形象照与原个人形象照相同。', '温馨提示');
                    }
                    $('.mfp-close').click();
                });
            })
        </script>
    </if>
<script>
    $(function(){
        $('.view-list').click(function(){
            var flash_url=$(this).attr('flash-url');
            var flash_title=$(this).attr('flash-title');
            $('#flash_html').html('<embed src="'+flash_url+'" autostart="false" allowFullScreen="true" quality="high" width="100%" height="470px" align="middle" allowScriptAccess="always"  wmode="Opaque" type="application/x-shockwave-flash" title="'+flash_title+'"></embed>');
        });
    });
</script>
</block>

